package com.miracle.java2110.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.miracle.java2110.pojo.Serviced;
import com.miracle.java2110.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("prototype")
public class WebServicedListener extends AnalysisEventListener<Serviced> {

    @Autowired
    MyService myService;

    @Override
    public void invoke(Serviced serviced, AnalysisContext analysisContext) {
        System.out.println(serviced);
        myService.addService(serviced);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
